﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace blackhouse.WebNemo.Business.Users {
	public class ImpNemoUser : INemoUser {

		#region Properties

		public int UserId { get; set; }
		public string Name { get; set; }

		public INemoUser[] Users { get; set; }

		#endregion

		#region Methods

		public INemoUser GetUser(int userId) {
			if (Users != null) return this.Users.FirstOrDefault(u => u.UserId == userId);
			else return null;
		}

		public INemoUser GetCurrentUser() {
			if (Users != null) return this.Users.FirstOrDefault();
			else return null;
		}

		public bool HasSufficientPermissions(bool redirectToAccessDenied) {
			return this.GetCurrentUser() != null;
		}

		#endregion

	}
}
